package com.company.test19;

import java.io.*;

/**
 * Created by Administrator on 2016.9.23.
 */
public class Test1901 {
    public static void main(String[] args) throws IOException {
        File file=new File("src/com/company/test19/Exercise1901.txt");
        DataOutputStream output=new DataOutputStream(new FileOutputStream(file));

        for (int i=0;i<100;i++){
            output.writeInt((int)(Math.random()*100));
        }

        output.close();

        DataInputStream input=new DataInputStream(new FileInputStream(file));

        try {
            while (true){
                System.out.println(input.readInt());
            }
        }catch (EOFException e){
            System.out.println("文件已经读取完毕");
        }
    }
}